package com.mingmen.canting.http.callback;


import android.app.Activity;
import android.app.ProgressDialog;
import android.view.Window;

import com.mingmen.canting.http.convert.StringConvert;
import com.mingmen.canting.http.request.BaseRequest;

import okhttp3.Call;
import okhttp3.Response;

/**
 * ================================================
 * 作    者：张宇
 * 版    本：1.0
 * 创建日期：2016/9/11
 * 描    述：返回字符串类型的数据
 * 修订历史：
 * ================================================
 */
public abstract class StringNoCallback extends AbsCallback<String> {



    private void initDialog(Activity activity) {

    }

    public StringNoCallback(Activity activity) {
        super();
        initDialog(activity);
    }

    @Override
    public String convertSuccess(Response response) throws Exception {
        String s = StringConvert.create().convertSuccess(response);
        response.close();
        return s;
    }

    @Override
    public void onError(Call call, Response response, Exception e) {
        super.onError(call, response, e);

    }

    @Override
    public void onBefore(BaseRequest request) {
        super.onBefore(request);
        //网络请求前显示对话框

    }

    @Override
    public void onAfter(String s, Exception e) {
        super.onAfter(s, e);

    }

}